    	window.onload=function(){
    		var showdiv=document.querySelector('div.list-add-area');
    		var ul=document.querySelector('ul.list-ul');
    		//显示与隐藏
    		document.querySelector('.list-add-show').onclick=function(){
    			showdiv.classList.remove('hide');
    		}
    		document.querySelector('input.list-add-cancel').onclick=function(){
    			showdiv.classList.add('hide');
    		}
    		//添加
    		document.querySelector('input.list-add-add').onclick=function(){
    	 		//创建li元素
    		var v=document.querySelector('input.list-add-input');
    		if(v.value.length!=0)
    		{
    		var newli=document.createElement('li');
    		var liattr=document.createAttribute('class');
    		liattr.value='list-option';
    		newli.setAttributeNode(liattr);
    		//创建input
    		var newinp=document.createElement('input');
    		newinp.setAttribute('class','list-input');
    		newinp.setAttribute('type','text');
    		newinp.setAttribute('value',v.value);
        newli.appendChild(newinp)
        v.value="";
    		//创建span
    		var newspan=new Array;
    	  for(var i=0;i<4;i++)
    	   newspan[i]=document.createElement('span');
    	  newspan[0].setAttribute('class','list-btn');
    	  //创建上移、下移、删除 
    	  newspan[1].setAttribute('class','list-up');
				newspan[1].innerHTML='[上移]';
				newspan[0].appendChild(newspan[1]);
				newspan[2].setAttribute('class','list-down');
				newspan[2].innerHTML='[下移]';
				newspan[0].appendChild(newspan[2]);
				newspan[3].setAttribute('class','list-del');
				newspan[3].innerHTML='[删除]';
				newspan[0].appendChild(newspan[3]);
    	  newli.appendChild(newspan[0]);    		
    		ul.appendChild(newli);}
    		else
    		alert('请输入内容');
    		}   		
		
    	}